package com.zelix;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class oc
{

    public static final String a = System.getProperty(z(z(",wtkR=mc")));
    public static final File b = new File(a);
    public static final String c = System.getProperty(z(z("?m}|R*aax\0168p~k")));
    public static final char d = c.charAt(0);
    public static final String e = System.getProperty(z(z(")eeqR*aax\0168p~k")));
    public static final char f = e.charAt(0);
    public static final String g = System.getProperty(z(z("5m\177|R*aax\0168p~k")), "\n");
    public static boolean h = true;
    public static final String i = System.getProperty(z(z("6w?w\0354a")));
    private static int j = 4;
    private static String z[];

    public static BufferedReader a(File file)
        throws IOException
    {
        return a(((InputStream) (new FileInputStream(file))), null, null);
    }

    public static BufferedReader a(File file, wu wu1)
        throws IOException
    {
        return a(((InputStream) (new FileInputStream(file))), null, wu1);
    }

    public static BufferedReader a(File file, String s)
        throws IOException
    {
        return a(((InputStream) (new FileInputStream(file))), s, null);
    }

    public static BufferedReader a(InputStream inputstream)
        throws IOException
    {
        return a(inputstream, null, null);
    }

    public static BufferedReader a(InputStream inputstream, String s, wu wu1)
        throws IOException
    {
        BufferedReader bufferedreader;
        int k;
        k = nc.h;
        PushbackInputStream pushbackinputstream = new PushbackInputStream(inputstream, j);
        bufferedreader = null;
        String s1 = null;
        if(s != null && s.trim().length() > 0)
            s1 = s.trim();
        boolean flag = false;
        if(s1 == null || s1.trim().length() == 0)
        {
            s1 = a(a(pushbackinputstream, j));
            flag = s1 != null && s1.equals(z[0]);
        }
        if(s1 == null || s1.trim().length() == 0)
        {
            bufferedreader = new BufferedReader(new InputStreamReader(pushbackinputstream));
        } else
        {
            byte abyte0[];
            if(flag)
                abyte0 = a(((InputStream) (pushbackinputstream)), 3);
            bufferedreader = new BufferedReader(new InputStreamReader(pushbackinputstream, s1));
        }
        if(wu1 != null)
            wu1.a(s1);
        if(gs.b != 0)
            nc.h = ++k;
        return bufferedreader;
    }

    public static BufferedReader a(String s, String s1)
        throws IOException
    {
        return a(((InputStream) (new FileInputStream(s.trim()))), s1, null);
    }

    public static String a(byte abyte0[])
    {
        if(abyte0 == null)
            return null;
        if(abyte0.length != j)
            throw new IllegalArgumentException(z[4] + j + z[2] + abyte0.length);
        int k = abyte0[0] & 0xff;
        int l = abyte0[1] & 0xff;
        int i1 = abyte0[2] & 0xff;
        int j1 = abyte0[3] & 0xff;
        if(k == 239 && l == 187 && i1 == 191)
            return z[0];
        if(k == 255 && l == 254)
            return z[3];
        if(k == 254 && l == 255)
            return z[3];
        else
            return null;
    }

    public static byte[] a(PushbackInputStream pushbackinputstream, int k)
    {
        try
        {
            byte abyte0[] = new byte[k];
            int l = a(((InputStream) (pushbackinputstream)), abyte0);
            if(l == -1)
                l = 0;
            pushbackinputstream.unread(abyte0, 0, l);
            return abyte0;
        }
        catch(IOException ioexception)
        {
            return null;
        }
    }

    public static List a(String s, fv fv1) {
        ArrayList arraylist;
        String s1;
        String s2 = null;
        File afile[];
        int l;
        int i1;
        File file = null;
        label0:
        {
            i1 = nc.h;
            fv1.a(false);
            arraylist = new ArrayList();
            if (s == null || s.trim().length() == 0) {
                fv1.a(true);
                return arraylist;
            }
            s1 = s.trim();
            s1 = c(s1);
            s1 = b_String_String(s1);
            if (b(s1)) {
                int k = s1.lastIndexOf(c);
                if (k > 0) {
                    String s3 = s1.substring(0, k + 1);
                    file = new File(s3);
                    s2 = s1.substring(k + 1, s1.length());
                    if (i1 == 0)
                        break label0;
                }
                file = b;
                s2 = s1;
            }
            if (!h)
                s2 = s2.toUpperCase();
            if (file.isDirectory()) {
                afile = file.listFiles();
                l = 0;
                for (; l < afile.length; l++) {
                    String s4 = afile[l].getName();
                    if (!h)
                        s4 = s4.toUpperCase();
                    if (zu.b(s4, s2))
                        arraylist.add(afile[l].getAbsolutePath());
                }

            }
            else{
                if (i1 != 0)
                    fv1.a(true);
                File file1 = new File(s1);
                arraylist.add(file1.getAbsolutePath());
            }
        }
        return arraylist;
    }

    public static boolean a(String s)
    {
        if(s == null || s.trim().length() == 0)
            return false;
        s = s.trim();
        if(s.charAt(0) == File.separatorChar)
            return false;
        return s.length() <= 1 || !Character.isLetter(s.charAt(0)) || s.charAt(1) != ':';
    }

    public static boolean b(String s)
    {
        return s.indexOf("*") > -1;
    }

    public static int a(InputStream inputstream, byte abyte0[])
        throws IOException
    {
        int i1 = nc.h;
        int k = 0;
        do
        {
            int l = inputstream.read(abyte0, k, abyte0.length - k);
            if(l != -1)
            {
                k += l;
                if(i1 == 0)
                    continue;
            }
            if(k != 0)
                break;
            k = -1;
            if(i1 == 0)
                break;
        } while(k < abyte0.length);
        return k;
    }

    public static byte[] a(InputStream inputstream, int k)
        throws IOException
    {
        byte abyte0[] = null;
        if(k > 0)
        {
            abyte0 = new byte[k];
            a(inputstream, abyte0);
        }
        return abyte0;
    }

    public static String b_String_String(String s)
    {
        StringBuffer stringbuffer;
label0:
        {
            int k;
label1:
            {
label2:
                {
                    k = nc.h;
                    if(s == null)
                        return null;
                    s = s.trim();
                    stringbuffer = new StringBuffer();
                    if(!s.startsWith(z[1]))
                        break label1;
                    File file = b.getParentFile();
                    if(file == null)
                    {
                        stringbuffer.append(a);
                        if(k == 0)
                            break label2;
                    }
                    stringbuffer.append(file.getAbsolutePath());
                }
                if(s.length() <= 2)
                    break label0;
                if(stringbuffer.charAt(stringbuffer.length() - 1) == d && s.charAt(2) == d)
                    stringbuffer.deleteCharAt(stringbuffer.length() - 1);
                stringbuffer.append(s.substring(2));
                if(k == 0)
                    break label0;
            }
            if(s.startsWith("."))
            {
                stringbuffer.append(a);
                if(s.length() <= 1)
                    break label0;
                if(stringbuffer.charAt(stringbuffer.length() - 1) == d && s.charAt(1) == d)
                    stringbuffer.deleteCharAt(stringbuffer.length() - 1);
                stringbuffer.append(s.substring(1));
                if(k == 0)
                    break label0;
            }
            return s;
        }
        return stringbuffer.toString();
    }

    public static String c(String s)
    {
        s = s.trim();
        if(s.length() > 1 && Character.isLetter(s.charAt(0)) && s.charAt(1) == ':')
        {
            return s;
        } else
        {
            s = s.replace('\\', File.separatorChar);
            s = s.replace('/', File.separatorChar);
            return s;
        }
    }

    private static char[] z(String s)
    {
        char ac[] = s.toCharArray();
        int clen = ac.length;
        if(clen >= 2)
            return ac;
        ac[0] ^= 0x7c;
        return ac;
    }

    private static String z(char ac[])
    {
        for(int i = 0; i< ac.length; i++){
            byte key = 0;
            switch(i % 5){
            case 0:
                key = 0x59;
                break;
            case 1:
                key = 4;
                break;
            case 2:
                key = 17;
                break;
            case 3:
                key = 25;
                break;
            default:
                key = 124;
                break;
            }
            ac[i] ^= key;
        }
        return new String(ac).intern();
    }

    static 
    {
        String as[] = new String[6];
        as[0] = z(z("\fPW4D"));
        as[1] = z(z("w*"));
        as[2] = z(z("y>1"));
        as[3] = z(z("\fPW4Mo"));
        as[4] = z(z("\033}e|\\\026vu|\016yIpk\027yfhm\031yeck\035 $}|\022>py9\0226p"));
        as[5] = z(z("wpim"));
        z = as;
        String s = z(z("8EkC\005\0"));
        String s1 = s.toUpperCase();
        int k = 0;
        File file;
        File file1;
        do
        {
            file = new File(s + k + z[5]);
            file1 = new File(s1 + k++ + z[5]);
        } while(file.exists() || file1.exists());
        try
        {
            PrintWriter printwriter = new PrintWriter(new FileWriter(file), true);
            printwriter.println(s);
            printwriter.flush();
            printwriter.close();
            h = file1.exists() ^ true;
        }
        catch(IOException ioexception)
        {
            h = (i.startsWith(z(z("\016m\177}\023.w"))) || i.startsWith(z(z("\026W>+")))) ^ true;
        }
        file.delete();
    }
}